Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENG-12511: Add data source for systemInfo API #455

Merged
merged 3 commits into from
Sep 26, 2023
Merged

Conversation

VictorGFM
Copy link
Contributor

@VictorGFM VictorGFM commented Sep 26, 2023

Description of the change

ENG-12511: Add data source for the new system info endpoint

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklists

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development

Code review

  • This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
  • Jira issue referenced in commit message and/or PR title

Testing

Tested by running automated tests with make command and performing manual E2E tests. See results below:

go test github.com/cyralinc/terraform-provider-cyral/... -v -race -timeout 20m
?   	github.com/cyralinc/terraform-provider-cyral	[no test files]
=== RUN   TestNewClient_WhenTLSSkipVerifyIsEnabled_ThenInsecureSkipVerifyIsTrue
2023/09/19 20:12:47 [DEBUG] Init NewClient
2023/09/19 20:12:47 [DEBUG] TokenSource: &{0xc00013cf00 {0 0} <nil> 0}
2023/09/19 20:12:47 [DEBUG] End NewClient
--- PASS: TestNewClient_WhenTLSSkipVerifyIsEnabled_ThenInsecureSkipVerifyIsTrue (0.00s)
=== RUN   TestNewClient_WhenTLSSkipVerifyIsDisabled_ThenInsecureSkipVerifyIsFalse
2023/09/19 20:12:47 [DEBUG] Init NewClient
2023/09/19 20:12:47 [DEBUG] TokenSource: &{0xc00013cf48 {0 0} <nil> 0}
2023/09/19 20:12:47 [DEBUG] End NewClient
--- PASS: TestNewClient_WhenTLSSkipVerifyIsDisabled_ThenInsecureSkipVerifyIsFalse (0.00s)
=== RUN   TestNewClient_WhenClientIDIsEmpty_ThenThrowError
2023/09/19 20:12:47 [DEBUG] Init NewClient
--- PASS: TestNewClient_WhenClientIDIsEmpty_ThenThrowError (0.00s)
=== RUN   TestNewClient_WhenClientSecretIsEmpty_ThenThrowError
2023/09/19 20:12:47 [DEBUG] Init NewClient
--- PASS: TestNewClient_WhenClientSecretIsEmpty_ThenThrowError (0.00s)
=== RUN   TestNewClient_WhenControlPlaneIsEmpty_ThenThrowError
2023/09/19 20:12:47 [DEBUG] Init NewClient
--- PASS: TestNewClient_WhenControlPlaneIsEmpty_ThenThrowError (0.00s)
PASS
ok  	github.com/cyralinc/terraform-provider-cyral/client	(cached)
=== RUN   TestAccDatalabelDataSource
=== PAUSE TestAccDatalabelDataSource
=== RUN   TestAccIntegrationIdPSAMLDataSource
=== PAUSE TestAccIntegrationIdPSAMLDataSource
=== RUN   TestAccLoggingIntegrationDataSource
=== PAUSE TestAccLoggingIntegrationDataSource
=== RUN   TestAccPermissionDataSource
=== PAUSE TestAccPermissionDataSource
=== RUN   TestAccRepositoryDataSource
=== PAUSE TestAccRepositoryDataSource
=== RUN   TestAccRoleDataSource
=== PAUSE TestAccRoleDataSource
=== RUN   TestAccSAMLCertificateDataSource
=== PAUSE TestAccSAMLCertificateDataSource
=== RUN   TestAccSAMLConfigurationDataSource
=== PAUSE TestAccSAMLConfigurationDataSource
=== RUN   TestAccSidecarBoundPortsDataSource
=== PAUSE TestAccSidecarBoundPortsDataSource
=== RUN   TestAccSidecarCftTemplateDataSource
=== PAUSE TestAccSidecarCftTemplateDataSource
=== RUN   TestAccSidecarIDDataSource
=== PAUSE TestAccSidecarIDDataSource
=== RUN   TestAccSidecarInstanceIDsDataSource
=== PAUSE TestAccSidecarInstanceIDsDataSource
=== RUN   TestAccSidecarListenerDataSource
=== PAUSE TestAccSidecarListenerDataSource
=== RUN   TestAccSystemInfoDataSource
=== PAUSE TestAccSystemInfoDataSource
=== RUN   TestIntegrationsData_GetValue_Default
--- PASS: TestIntegrationsData_GetValue_Default (0.00s)
=== RUN   TestIntegrationsData_GetValue_Splunk
--- PASS: TestIntegrationsData_GetValue_Splunk (0.00s)
=== RUN   TestAccProvider
2023/09/26 18:05:46 [DEBUG] Init dataSourceSidecarListener
2023/09/26 18:05:46 [DEBUG] End dataSourceSidecarListener
--- PASS: TestAccProvider (0.01s)
=== RUN   TestAccDatalabelResource
=== PAUSE TestAccDatalabelResource
=== RUN   TestAccDatadogIntegrationResource
=== PAUSE TestAccDatadogIntegrationResource
=== RUN   TestAccELKIntegrationResource
=== PAUSE TestAccELKIntegrationResource
=== RUN   TestAccHCVaultIntegrationResource
=== PAUSE TestAccHCVaultIntegrationResource
=== RUN   TestAccIntegrationIdPSAMLDraftResource
=== PAUSE TestAccIntegrationIdPSAMLDraftResource
=== RUN   TestAccIntegrationIdPSAMLResource
=== PAUSE TestAccIntegrationIdPSAMLResource
=== RUN   TestAccIdPIntegrationResource
=== PAUSE TestAccIdPIntegrationResource
=== RUN   TestAccLogsIntegrationResourceCloudWatch
=== PAUSE TestAccLogsIntegrationResourceCloudWatch
=== RUN   TestAccLogsIntegrationResourceDataDog
=== PAUSE TestAccLogsIntegrationResourceDataDog
=== RUN   TestAccLogsIntegrationResourceElk
=== PAUSE TestAccLogsIntegrationResourceElk
=== RUN   TestAccLogsIntegrationResourceElkEmptyEsCredentials
=== PAUSE TestAccLogsIntegrationResourceElkEmptyEsCredentials
=== RUN   TestAccLogsIntegrationResourceSplunk
=== PAUSE TestAccLogsIntegrationResourceSplunk
=== RUN   TestAccLogsIntegrationResourceSumologic
=== PAUSE TestAccLogsIntegrationResourceSumologic
=== RUN   TestAccLogsIntegrationResourceFluentbit
=== PAUSE TestAccLogsIntegrationResourceFluentbit
=== RUN   TestAccLogstashIntegrationResource
=== PAUSE TestAccLogstashIntegrationResource
=== RUN   TestAccLookerIntegrationResource
=== PAUSE TestAccLookerIntegrationResource
=== RUN   TestAccDuoMFAIntegrationResource
=== PAUSE TestAccDuoMFAIntegrationResource
=== RUN   TestAccPagerDutyIntegrationResource
=== PAUSE TestAccPagerDutyIntegrationResource
=== RUN   TestAccSlackAlertsIntegrationResource
=== PAUSE TestAccSlackAlertsIntegrationResource
=== RUN   TestAccSplunkIntegrationResource
=== PAUSE TestAccSplunkIntegrationResource
=== RUN   TestAccSumoLogicIntegrationResource
=== PAUSE TestAccSumoLogicIntegrationResource
=== RUN   TestAccMsTeamsIntegrationResource
=== PAUSE TestAccMsTeamsIntegrationResource
=== RUN   TestAccPolicyRuleResource
=== PAUSE TestAccPolicyRuleResource
=== RUN   TestPolicyRuleResourceUpgradeV0
--- PASS: TestPolicyRuleResourceUpgradeV0 (0.00s)
=== RUN   TestAccPolicyResource
=== PAUSE TestAccPolicyResource
=== RUN   TestAccRegoPolicyInstanceResource
=== PAUSE TestAccRegoPolicyInstanceResource
=== RUN   TestAccRepositoryAccessGatewayResource
=== PAUSE TestAccRepositoryAccessGatewayResource
=== RUN   TestAccRepositoryAccessRulesResource
=== PAUSE TestAccRepositoryAccessRulesResource
=== RUN   TestAccRepositoryBindingResource
=== PAUSE TestAccRepositoryBindingResource
=== RUN   TestAccRepositoryConfAnalysisResource
=== PAUSE TestAccRepositoryConfAnalysisResource
=== RUN   TestRepositoryConfAnalysisResourceUpgradeV0
--- PASS: TestRepositoryConfAnalysisResourceUpgradeV0 (0.00s)
=== RUN   TestAccRepositoryConfAuthResource
=== PAUSE TestAccRepositoryConfAuthResource
=== RUN   TestRepositoryConfAuthResourceUpgradeV0
--- PASS: TestRepositoryConfAuthResourceUpgradeV0 (0.00s)
=== RUN   TestAccRepositoryDatamapResource
=== PAUSE TestAccRepositoryDatamapResource
=== RUN   TestAccRepositoryNetworkAccessPolicyResource
=== PAUSE TestAccRepositoryNetworkAccessPolicyResource
=== RUN   TestAccRepositoryResource
=== PAUSE TestAccRepositoryResource
=== RUN   TestAccRepositoryUserAccountResource
=== PAUSE TestAccRepositoryUserAccountResource
=== RUN   TestAccRoleSSOGroupsResource
=== PAUSE TestAccRoleSSOGroupsResource
=== RUN   TestRoleSSOGroupsResourceUpgradeV0
--- PASS: TestRoleSSOGroupsResourceUpgradeV0 (0.00s)
=== RUN   TestAccRoleResource
=== PAUSE TestAccRoleResource
=== RUN   TestAccServiceAccountResource
=== PAUSE TestAccServiceAccountResource
=== RUN   TestAccSidecarCredentialsResource
=== PAUSE TestAccSidecarCredentialsResource
=== RUN   TestSidecarListenerResource
=== PAUSE TestSidecarListenerResource
=== RUN   TestAccSidecarResource
=== PAUSE TestAccSidecarResource
=== RUN   TestElementsMatch
--- PASS: TestElementsMatch (0.00s)
=== CONT  TestAccLoggingIntegrationDataSource
=== CONT  TestAccLogsIntegrationResourceSumologic
=== CONT  TestAccLogsIntegrationResourceElk
=== CONT  TestAccELKIntegrationResource
=== CONT  TestAccSidecarListenerDataSource
=== CONT  TestAccLogsIntegrationResourceSplunk
=== CONT  TestAccLogsIntegrationResourceElkEmptyEsCredentials
=== CONT  TestAccLogsIntegrationResourceFluentbit
=== CONT  TestAccLogsIntegrationResourceDataDog
--- PASS: TestAccLogsIntegrationResourceFluentbit (7.64s)
=== CONT  TestAccIdPIntegrationResource
--- PASS: TestAccELKIntegrationResource (8.16s)
=== CONT  TestAccLogsIntegrationResourceCloudWatch
--- PASS: TestAccLogsIntegrationResourceElkEmptyEsCredentials (8.67s)
=== CONT  TestAccRepositoryAccessRulesResource
--- PASS: TestAccLogsIntegrationResourceElk (8.72s)
--- PASS: TestAccLogsIntegrationResourceSplunk (8.73s)
=== CONT  TestAccRepositoryAccessGatewayResource
--- PASS: TestAccLogsIntegrationResourceSumologic (8.74s)
=== CONT  TestAccRepositoryBindingResource
--- PASS: TestAccLoggingIntegrationDataSource (10.67s)
=== CONT  TestAccRegoPolicyInstanceResource
--- PASS: TestAccLogsIntegrationResourceDataDog (6.17s)
=== CONT  TestAccSidecarResource
=== CONT  TestAccPolicyResource
--- PASS: TestAccLogsIntegrationResourceCloudWatch (6.89s)
--- PASS: TestAccRegoPolicyInstanceResource (6.84s)
=== CONT  TestAccSumoLogicIntegrationResource
--- PASS: TestAccSidecarListenerDataSource (18.95s)
=== CONT  TestAccServiceAccountResource
=== CONT  TestSidecarListenerResource
--- PASS: TestAccRepositoryBindingResource (10.76s)
=== CONT  TestAccDatadogIntegrationResource
--- PASS: TestAccPolicyResource (7.03s)
--- PASS: TestAccRepositoryAccessRulesResource (13.91s)
=== CONT  TestAccRoleResource
=== CONT  TestAccIntegrationIdPSAMLDraftResource
--- PASS: TestAccSumoLogicIntegrationResource (7.11s)
=== CONT  TestAccRoleSSOGroupsResource
--- PASS: TestAccRepositoryAccessGatewayResource (19.58s)
=== CONT  TestAccSidecarCredentialsResource
--- PASS: TestAccDatadogIntegrationResource (6.60s)
=== CONT  TestAccRepositoryConfAnalysisResource
--- PASS: TestAccIntegrationIdPSAMLDraftResource (10.71s)
--- PASS: TestAccSidecarCredentialsResource (7.84s)
=== CONT  TestAccRepositoryDatamapResource
=== CONT  TestAccHCVaultIntegrationResource
--- PASS: TestAccSidecarResource (28.20s)
--- PASS: TestAccRoleSSOGroupsResource (14.00s)
=== CONT  TestAccMsTeamsIntegrationResource
=== CONT  TestAccDuoMFAIntegrationResource
--- PASS: TestAccRoleResource (19.95s)
--- PASS: TestAccServiceAccountResource (24.24s)
=== CONT  TestAccSplunkIntegrationResource
--- PASS: TestAccRepositoryConfAnalysisResource (9.84s)
=== CONT  TestAccSlackAlertsIntegrationResource
=== CONT  TestAccPagerDutyIntegrationResource
--- PASS: TestAccIdPIntegrationResource (40.34s)
--- PASS: TestAccMsTeamsIntegrationResource (7.08s)
=== CONT  TestAccLookerIntegrationResource
--- PASS: TestAccHCVaultIntegrationResource (8.12s)
=== CONT  TestAccRepositoryNetworkAccessPolicyResource
--- PASS: TestAccDuoMFAIntegrationResource (8.10s)
=== CONT  TestAccPolicyRuleResource
--- PASS: TestAccSplunkIntegrationResource (7.84s)
=== CONT  TestAccDatalabelResource
--- PASS: TestAccSlackAlertsIntegrationResource (7.23s)
=== CONT  TestAccSidecarInstanceIDsDataSource
=== CONT  TestAccIntegrationIdPSAMLResource
--- PASS: TestAccPagerDutyIntegrationResource (8.13s)
=== CONT  TestAccSidecarIDDataSource
--- PASS: TestAccLookerIntegrationResource (8.26s)
--- PASS: TestSidecarListenerResource (38.76s)
=== CONT  TestAccRepositoryUserAccountResource
=== CONT  TestAccSidecarCftTemplateDataSource
--- PASS: TestAccDatalabelResource (9.31s)
--- PASS: TestAccSidecarInstanceIDsDataSource (8.00s)
=== CONT  TestAccRepositoryResource
--- PASS: TestAccRepositoryDatamapResource (25.07s)
=== CONT  TestAccSystemInfoDataSource
--- PASS: TestAccSidecarIDDataSource (7.04s)
=== CONT  TestAccPermissionDataSource
--- PASS: TestAccSystemInfoDataSource (4.84s)
=== CONT  TestAccRoleDataSource
--- PASS: TestAccPermissionDataSource (4.96s)
=== CONT  TestAccSidecarBoundPortsDataSource
=== CONT  TestAccSAMLCertificateDataSource
--- PASS: TestAccSidecarCftTemplateDataSource (12.19s)
--- PASS: TestAccPolicyRuleResource (22.06s)
=== CONT  TestAccSAMLConfigurationDataSource
--- PASS: TestAccRoleDataSource (6.88s)
=== CONT  TestAccIntegrationIdPSAMLDataSource
--- PASS: TestAccRepositoryNetworkAccessPolicyResource (25.18s)
=== CONT  TestAccRepositoryDataSource
=== CONT  TestAccRepositoryConfAuthResource
--- PASS: TestAccSAMLCertificateDataSource (4.72s)
=== CONT  TestAccDatalabelDataSource
--- PASS: TestAccIntegrationIdPSAMLResource (21.43s)
=== CONT  TestAccLogstashIntegrationResource
--- PASS: TestAccSAMLConfigurationDataSource (10.56s)
--- PASS: TestAccSidecarBoundPortsDataSource (14.88s)
--- PASS: TestAccRepositoryResource (25.77s)
--- PASS: TestAccIntegrationIdPSAMLDataSource (17.54s)
--- PASS: TestAccRepositoryDataSource (16.36s)
--- PASS: TestAccRepositoryConfAuthResource (17.99s)
--- PASS: TestAccLogstashIntegrationResource (14.78s)
--- PASS: TestAccDatalabelDataSource (21.28s)
--- PASS: TestAccRepositoryUserAccountResource (51.28s)
PASS
ok  	github.com/cyralinc/terraform-provider-cyral/cyral	110.274s

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@VictorGFM VictorGFM marked this pull request as ready for review September 26, 2023 21:09
Copy link
Contributor

@Yowgf Yowgf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wcmjunior wcmjunior merged commit 2583fe2 into main Sep 26, 2023
3 checks passed
@wcmjunior wcmjunior deleted the feature/ENG-12511 branch September 26, 2023 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants